from selenium import webdriver
from selenium.webdriver.common.by import By
import time
# 创建浏览器驱动对象
driver = webdriver.Chrome()
# 加载web页面
driver.get("http://121.43.169.97:8848/pageA.html")
# 放大浏览器
driver.maximize_window()
# 暂停3秒
time.sleep(3)
driver.set_window_size(800,600)
time.sleep(3)
driver.set_window_position(0,500) #将窗口移至屏幕坐标0，500
# id选择器
driver.find_element(By.CSS_SELECTOR,"#userA").send_keys("admin")
# 刷新
# 暂停3秒
time.sleep(3)
driver.refresh()
# 获取标题
print(driver.title)
# 获取网页地址
print(driver.current_url)

# 暂停3秒
time.sleep(3)
# 关闭驱动对象
driver.quit()